#include <iostream>

using namespace std;

class Point
{
public:
    Point(int x, int y);
    ~Point();
    void print();

private:
    int *_ix;
    int *_iy;

};

Point::Point(int x, int y):_ix(new int), _iy(new int)
{
    *_ix = x;
    *_iy = y;
}

Point::~Point()
{
    if(_ix)
        delete _ix;
    if(_iy)
        delete _iy;

    _ix = nullptr;
    _iy = nullptr;
}

void Point::print()
{
    cout << "(" << *_ix << "," << *_iy << ")" << endl;
}

void test()
{
    Point p = {1,2};
    p.print();
}

int main()
{
    test();
    return 0;
}

